1. Field of the Invention
Exemplary embodiments of the present invention relate to a technique for generating a random number; and, particularly, to a method of generating a random number using nonvolatile memory in a two-track scheme and an apparatus for the same.
2. Description of Related Art
A random number generator provides a random number to be used in application programs such as certification or encryption using an algorithm for generating a random number. Specifically, a random number generated by a random number generator imparts security and integrity to application programs.
Random number generators may be broadly classified into hardware random number generators and software random number generators. Generally, hardware random number generators have the advantage of high speed compared to software random number generators, but, however, have the disadvantages of high cost and time required for the development thereof. On the other hand, software random number generators have the advantages of low cost and short time for development, but conversely have the disadvantage of low generation speed compared to hardware random number generators.
Despite these shortcomings, the software random number generator has been recently used in various fields, and active research is being conducted thereon.
Embedded systems having software random number generators are broadly classified into SRAM (Static Random Access Memory)-based products and flash memory-based products, with SRAM-based products occupying the greatest market share.
The random number generator is inputted with an internal state (or seed) constructed using various entropy sources, and updates the internal state to generate a random number that is unpredictable. The SRAM-based random number generator has a volatile characteristic, and so information about its state, which is stored in memory, disappears when the power supply is cut off. Accordingly, in order to store state information, the existing SRAM-based random number generator has an external backup battery so that information about the state of the generator can be continuously stored to SRAM, regardless of whether power is being supplied.
FIG. 1 is a block diagram showing an embedded system including a SRAM-based random number generator according to the related art.
With respect to FIG. 1, information about the state of a random number generator is stored in SRAM 102, and when power is supplied through an external power source 101, a microprocessor 107 loads information about the state of the random number generator stored in SRAM 102 to send it to SDRAM 106, where the process of generating a random number is performed. As an algorithm for generating a random number, a standard HASH algorithm such as SHA-256 or the like can be used.
In a nonvolatile memory 108, a program for booting an embedded system, a device control program and an initialization program are stored. The information (program) stored in the nonvolatile memory is not deleted, even when the supply of power is cut off.
Accordingly, if nonvolatile memory is used in place of SRAM, it can prevent problems from occurring when the supply of power is cut off, but there is other problem in that the nonvolatile memory has limitation on number of writing and no limitation on the number of reading.
A backup battery 104 provides power necessary for operation of the SRAM 102 through a power switching circuit 103 when an external power source 101 is cut off.
The external power source 101 provides power for system operation.
The power switching circuit 103 performs switching by comparing the voltage level of the external power source 101 with that of the backup battery 104. For example, the power switching circuit 103 maintains the supply of power from the internal backup battery 104 to the SRAM 102 when the external power source 101 is off.
The backup battery 104 provides power to the SRAM 102 when the external power source 101 is cut off, and provides power for operating the RTC (Real Time Clock) 105.
The RTC 105 provides time information for use as an entropy source when generating a random number. The value generated in the RTC 105 is used as a seed for the random number generator.
As described above, embedded systems including the existing random number generator use SRAM, and so there are many problems that a circuit for supplying power from a battery is necessary in case external power is cut off, and the lifetime of the battery affects the lifetime of the entire embedded system.
Accordingly, a new technique capable of generating random number more effectively in an embedded system is seriously needed.